<script setup lang="ts">
import { ref } from 'vue'

const img = ref([
  { id: 1, url: '/static/swiper_img/img01.jpg' },
  { id: 2, url: '/static/swiper_img/img02.jpg' },
  { id: 3, url: '/static/swiper_img/img03.jpg' },
  { id: 4, url: '/static/swiper_img/img04.jpg' },
])
const openBigImag = (url: string) => {
  uni.previewImage({
    urls: img.value.map((item) => item.url),
    current: url,
  })
}
</script>

<template>
  <swiper
    :indicator-dots="true"
    class="banner"
    autoplay
    circular
    style="height: 750rpx !important"
    indicator-color="#ffffff"
    indicator-active-color="#e94618"
  >
    <swiper-item v-for="item in img" :key="item.id">
      <image :src="item.url" @tap="openBigImag(item.url)"></image>
    </swiper-item>
  </swiper>
</template>

<style lang="scss"></style>
